<template>
	<div style="height: 400px; border: 1px solid blue;">
		<h3>教的班级和课程</h3>
		<table border="1" class="ce">
			<tr>
				<th>班级</th>
				<th>课程</th>
				<th>操作</th>
			</tr>
			<tr v-for="(x,idx) in data.marks">
				<td>{{x.clz.clzname}}</td>
				<td>{{x.course.cname}}</td>
				<td><button @click="domark(x)">登分</button></td>
			</tr>
		</table>
	</div>
</template>

<script setup>
	import {ref,reactive,onMounted} from 'vue'
	import {$get,$postx,$postf} from "../../ajax/index.js";
	import myalert from "../../utils/myalert.js";
import router from '../../router/index.js';
	const data =reactive({
		marks:[],
	})
	 onMounted(()=>{
		 $get("/api/fore/tea/findMyTask")
		 .then((reap)=>{
			 myalert("获取数据完毕.."+reap.data.data.length)
			 console.log(reap.data.data);
			 data.marks=reap.data.data;
		 })
	 })
	 function domark(x){
		 router.push({
		path:'/tea/domark',
		 query:{
			 clzno:x.clz.clzno,
			 cno:x.course.cno
		 }	 
		 })
		 
		 
	 }
	
</script>

<style>
	.ce{
		margin-left: auto;
		margin-right: auto;
	}
</style>
